Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Buffers.​MemoryPool<​T>

Assembly: System.Memory

Inheritance: object → MemoryPool

Implemented Interfaces

Represents a pool of memory blocks.

Properties

public int
MaxBufferSize
Gets the maximum buffer size supported by this pool.
public static MemoryPool<​T>
Shared
Gets a singleton instance of a memory pool based on arrays.

Methods

public void
Dispose​()
Frees all resources used by the memory pool.
protected void
Dispose​(bool disposing)
Frees the unmanaged resources used by the memory pool and optionally releases the managed resources.
disposing <see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.
public IMemoryOwner<​T>
Rent​(int minBufferSize = -1)
Returns a memory block capable of holding at least <paramref name="minBufferSize" /> elements of T.
Returns A memory block capable of holding at least <paramref name="minBufferSize" /> elements of T.
minBufferSize The minimum number of elements of <typeparamref name="T" /> that the memory pool can hold. A value of -1 returns a memory pool set to the default size for the pool.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object